﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Common.Logging;

namespace MailCrawler.Workflow
{
	public static class RuleFetcher
	{
        private static readonly ILog Log = LogManager.GetCurrentClassLogger();

        public static List<Rule> Rules=new List<Rule>();
        static RuleFetcher()
        {
            var proxiStr = File.ReadAllLines("Rules.txt");
            foreach (var s in proxiStr)
            {
                Rules.Add(new Rule() {rule = s});
            }
            Log.Debug("Found "+Rules.Count+" rules");
        }
        public static void Save()
        {
            var v = from a in Rules select a.rule;
            File.WriteAllLines("Rules.txt",v.ToArray());
        }
	}
    public class Rule
    {
        public string rule { get; set; }
    }
}
